<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-08 14:55:13
 * @LastEditTime : 2020-01-14 14:30:37
 * @LastEditors  : Please set LastEditors
 -->
<template>
    <search-table
	    ref="searchTable"
		:columns="taskCol" 
        :data="taskData"
		:total="taskTotal"
		:page.sync="taskCurrentPage"
		:size.sync="taskItemPage"
		@change-size="switchTaskItemPage"
		@change-page="switchineTaskCurrentPage"
	>
    <template slot="search">
        <Button type="primary" ghost @click="createFlagTask" :disabled="disabledAllBtn" class="zIndexStyleBtn"><Icon type="ios-add" :size="16" class="position_i"/>添加任务</Button>
            <Button type="primary" ghost @click="configuringPortDetection" :disabled="disabledAllBtn"
                v-if="configMode !== 1"
                    icon="ios-options" class="zIndexStyleBtn">一键配置ip端口检测</Button>
            <!--<Poptip
                :confirm = true
                title="您确定要删除这些任务吗？"
                placement="right"
                @on-ok="deleteManyTask"
                @on-cancel="cancel">
                <Button type="primary" class="zIndexStyleBtn"><Icon type="md-trash" :size="16" class="position_i"/>删除任务</Button>
            </Poptip>-->
            <!-- <Button type="primary" @click="configeManage" class="zIndexStyleBtn"><Icon type="md-settings" :size="16" class="position_i"/>配置管理</Button> -->
    </template>
        <Modal
                v-model="createFlagTaskModal"
                title="Checker任务"
                ok-text = "确定"
                width=600
                :loading = createFlagTaskModalLoading
                @on-ok="ok"
                @on-cancel="cancel">
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
                <FormItem label="名字" prop="name">
                    <Input v-model.trim="formValidate.name" placeholder="请输入名称" clearable :maxlength="64"></Input>
                </FormItem>
                <!--<FormItem label="类型" prop="taskMode">
                    <RadioGroup v-model="formValidate.taskMode">
                        <Radio label="preset" :disabled="disabledTepBol">流程任务</Radio>
                        <Radio label="preset" :disabled="disabledTepBol">预设临机任务</Radio>
                        <Radio label="temp" :disabled="!disabledTepBol">实时任务</Radio>
                    </RadioGroup>
                </FormItem>-->
                <FormItem label="周期" prop="expireTime">
                    <!--<RadioGroup v-model="formValidate.expireTime">
                       <Radio label="180">3分钟</Radio>
                       <Radio label="300">5分钟</Radio>
                       <Radio label="420">7分钟</Radio>
                       <Radio label="480">8分钟</Radio>
                       <Radio label="600">10分钟</Radio>
                   </RadioGroup>-->
                    <InputNumber :min="1"  v-model="formValidate.expireTime" style="width:200px"></InputNumber> （秒）
                </FormItem>
                <FormItem label="配置" prop="configer" style="position:relative">
                    <Select filterable v-model="formValidate.configer" placeholder="请选择检测配置"   filterable clearable @on-change="listenConfigerChange" @on-clear="clearConfigerChange" ref="store">
                        <Option  v-for="item in configurationData" :key="item.id" :value="item.id"  @mouseenter.native="mouseOverConfiger($event,item.id)" @mouseleave.native="mouseLeaveConfiger($event,item.id)" @click.native="ddd">{{item.name}}</Option>
                    </Select>
                    <div v-show="configurationInformation" :style="{position:'absolute',left:cardPanelLeft,top:cardPanelTop,zIndex:'9999999999999999',}" @mouseenter="jinru" @mouseleave="yichu" @click="ddd">
                        <Card :style="{minWidth:'350px',maxWidth:'600px'}"  >
                            <p slot="title" style="position:relative">
                                <Icon type="ios-construct"></Icon>
                                {{configPanel.configName}}
                                <span slot="title" style="position:absolute;right:0px">
                                    <Icon type="ios-contact"></Icon>
                                    {{configPanel.configCreatorName}}
                                </span>
                            </p>
                            <ul>
                                <li><span class="_dot"></span>文件路径：{{configPanel.configPath}}</li>
                                <li><span class="_dot"></span>参数：{{configPanel.configArg}}</li>
                                <li><span class="_dot"></span>执行示例：{{configPanel.configCmd}}</li>
                                <li><span class="_dot"></span>操作系统：{{configPanel.configSystype}}</li>
                                <li><span class="_dot"></span>协议类型：{{configPanel.protocol}}</li>
                                <li><span class="_dot"></span>端口：{{configPanel.serverPort}}</li>
                                <li><span class="_dot"></span>语言：{{configPanel.language}}</li>
                                <!-- <li><span class="_dot"></span>
                                    configContent：
                                    <div v-for="item in configPanel.configContent" style="padding-left:15px">{{item.configCmd +'      /  ' +item.configArg}}</div>
                                </li> -->
                                <li><span class="_dot"></span>创建时间：{{configPanel.configCreateTime}}</li>
                                <li><span class="_dot"></span>描述：{{configPanel.configDescription}}</li>
                            </ul>
                        </Card>
                    </div>
                </FormItem>
                <FormItem label="服务端口" prop="serverPort">
                    <Input :disabled="disabledPort || portInputDisabled" v-model.trim="formValidate.serverPort" style="width:200px"
                           placeholder="请输入题目的服务端口"></Input>
                </FormItem>
                <!-- <div v-show="configerParams" :style="{'border':'1px solid #ddd','boxShadow': boxShadow,'borderRadius': '5px','padding': '20px','cursor':'pointer'}" @mouseover="overStyle" @mouseout="removeStyle">
                    <p style="text-align:center;font-size:16px">配置详情</p>
                    <FormItem label="Profile" prop="Profile" >
                        <span class="_dot" style="position:absolute;left:-62px;top:11px"></span>
                        <Input v-model.trim="formValidate.Profile"  readonly="readonly"></Input>
                    </FormItem>
                    <FormItem label="osInfo" prop="osInfo" >
                        <span class="_dot" style="position:absolute;left:-62px;top:11px"></span>
                        <pre v-model="formValidate.osInfo">{{formValidate.osInfo}}</pre>
                    </FormItem>
                    <FormItem label="类型" prop="type" >
                        <span class="_dot" style="position:absolute;left:-52px;top:11px"></span>
                        <Input v-model.trim="formValidate.type"  readonly="readonly"></Input>
                    </FormItem>
                    <FormItem label="指令" prop="configContent" >
                        <span class="_dot" style="position:absolute;left:-52px;top:11px"></span>
                        <div v-for="item in formValidate.configContent" style="padding-left:15px">{{item.cmd +'/'+item.args}}</div>
                    </FormItem>
                </div> -->
                <FormItem v-model="formValidate.selectedVmData"  :label="type !== 7 ? '题目' : '任务'">
                    <span  class="starlet">*</span>
                    <input type="hidden" >
                    <!--formValidate.selectedVmData-->
                    <Tag 
                        v-for="(item, index) in showSelectedVmData" 
                        :key="`${item.id}+${index}`" 
                        :name="item.questionId" 
                        closable 
                        @on-close="handleClose2" 
                        color="primary" 
                        type='dot'>{{ type !== 7 ? item.name : item.targetName }}</Tag>
                </FormItem>
                <div style="text-align:right">
                    <Button type="primary" @click="addSelectedData" style="margin-right:155px">添加</Button>
                    <Input :placeholder="`请输入${type !== 7 ? '题目' : '任务'}名称`" style="width: 140px" v-model.trim="formValidate.vmName" clearable></Input>
                    <Input placeholder="请输入IP" style="width: 140px" v-model.trim="formValidate.vmIP" clearable></Input>

                    <!--<Select filterable  v-model="formValidate.networkId" style="width: 140px;text-align:left" placeholder="请选择子网络" clearable>
		              <Option value="all">所有</Option>
		              <Option  v-for="item in subnetList" :value="item.id"  :key="item.id">{{item.name}}</Option>
		            </Select>-->
                    <Button type="primary" @click="refreshVmList" style="margin-left:5px">搜索</Button>
                </div>
                <Table border ref="" :columns="columnsVmList" :data="showDataVmList"  :stripe="showStripe" :show-header="showHeader" :size="tableSize" style="margin-top:10px" @on-selection-change="getSelectedData"></Table>
                <!--{{showDataVmList}}-->
                <!--<Page :total="vmTotal"   :current="vmCurrentPage" :page-size="vmItemPage" :show-total= true  @on-change="switchineVmCurrentPage" @on-page-size-change="switchVmItemPage" class-name="pageStyleVm"/>-->
                <!--<FormItem label="属性" >
                    <cusAttribute ref="cusAttribute" @func="getMsgFormSon" v-bind:msgVal="propertiesData" v-if="createFlagTaskModal"></cusAttribute>
                </FormItem>
                 <FormItem label="描述" prop="desc" style="margin-top:10px">
                    <Input v-model.trim="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入内容" clearable :maxlength="200"></Input>
                </FormItem>-->
            </Form>
        </Modal>
        <Modal
                v-model="taskDeailModal"
                title="任务启动详情"
                width = '80' footer-hide>
            <Table border ref="" :columns="taskDeailColumns" :data="taskDeailData"  :stripe="showStripe" :show-header="showHeader" :size="tableSize" @on-expand="hostDeail" ></Table>
        </Modal>
        <Modal
                v-model="taskConfigerMess"
                width = "80%"
                title="循环带外采集配置"
                okText = "关闭"
                cancelText=""
                @on-cancel = "clickEvent"
                @on-ok = "clickEvent">
            <!--<outbandCaptureCollect ref="outband"></outbandCaptureCollect>-->
        </Modal>
    </search-table>
</template>
<script>
    //import axios from '@/libs/api.request'
    //import outbandCaptureCollect from '@/components/configer/outbandCaptureCollect'
    // import processControl from '@/components/topologyDisplay/processPanel/processControl'
    import cusAttribute from '@/view/drill_compete/page/cusAttribute'
    import {saveoutbandTask,getTaskList,deleteTask,updateTask,amendTask,activeTask,taskDetail,taskDetailHis,deleteManyTask,hostDetail,getTaskListDetailData,showConfiguration,getDeviceList,loadConfiguration,getstatusbyprjid} from '@/api/drill'
    import {getaccessgrouplist} from '@/api/access_new'
    import {queryTargetAllot,getSceneInfo,queryNetworkList,queryVmWithParty,queryCtfTargetAllot} from '@/api/drill_compete'
    import { taskCol } from './taskMixin';
    const validateName = (rule, value, callback) => {
        var myReg = /[~!！@#$%^&*()/\|,<>?"'“‘();:+=\[\]{}]/;
        value = value.replace(/\s*/g,"");
        if(!value){
            callback("请填写名字");
        }else{
            if (myReg.test(value)) {
                callback("名字不能包含特殊字符");
            } else {
                callback();
            }
        }
    };
    const validatePort = (rule, value, callback) => { //验证只能填入数字
        var reg = new RegExp("^(([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5]))$");
        //验证警戒值
        if(value){
            if (!reg.test(Number(value))) {
                callback(new Error('请输入1-65535的整数'));
            }else{
                callback()
            }
        }else{
            callback()
        }
    }
    const validateCycle = (rule, value, callback) => { // 验证周期
        if (Number.isInteger(value)) {
            if (value < 1 || value > 600) {
                callback(new Error('请输入1-600的整数'));
            } else {
                callback()
            }
        } else {
            callback(new Error('请输入整数'));
        }
    }

    export default {
        name:"topoOutband",
        components:{
            //outbandCaptureCollect
            cusAttribute
        },
        props:['type','disabledAllBtn','configMode'],
        mixins:[taskCol],
        data(){
            return{
                portInputDisabled: false,
                tableHeight:'',
                panelWidth:'',
                taskConfigerMess:false,
                currentProjectId:"",
                taskTypeTable:'checker',
                taskTypeTableTitle:"循环带外采集",
                selectedData:[],
                selectedDataConfiger :[],
                // amendTaskId:"",
                headerData:{
                    serintervalTimeFun:{}
                },
                columnsData: [
//              {
//                  type: 'selection',
//                  width: 60,
//                  align: 'center',
//
//              },
                    {
                        title: this.$t('name'),
                        key: 'name',
                        align:'center',
                        placement:'top-left',
                        width:200,
                        tooltip:true
                    },
                    // {
                    //     title: 'TaskType',
                    //     key: 'taskType',
                    //      align:'center'
                    // },
                    // {
                    //     title: this.$t('ConfigurationName'),
                    //     key: 'configName',
                    //     align:'center'
                    // },
                    // {
                    //     title: 'id',
                    //     key: 'id',
                    //     visible:false
                    // },
                    {
                        title: this.$t('creatorName'),
                        key: 'creatorName',
                        align:'center',
                        width:100,
                        tooltip:true
                    },
                    {
                        title: this.$t('CTime'),
                        key: 'created',
                        align:'center'
                    },
//              {
//                  title:this.$t('Desc'),
//                  key:'description',
//                  align:'center'
//              },
                    {
                        title: this.$t('Status'),
                        key: 'status',
                        align:'center',
                        width:80,
                        placement:'top-right',
                        render:(h,params)=>{
                            switch (params.row.status) {
                                case "running":
                                    return h('Tag',{
                                        props:{
                                            type:'border',
                                            color:'success'
                                        },
                                    },'运行中')
                                    break;
                                case "error":
                                case "failed":
                                    return h('Tag',{
                                        props:{
                                            type:'border',
                                            color:'error'
                                        },
                                    },'失败')
                                    break;
                                case "completed":
                                    return h('Tag',{
                                        props:{
//                                      text:'完成',
                                            type:'border',
                                            color:'primary'
                                        },
                                    },'完成')
                                    break;
                                case "initialized":
                                    return h('Tag',{
                                        props:{
//                                      text:'初始化',
                                            type:'border',
                                            color:'default'
                                        },
                                    },'初始化')
                                    break;
                                case "starting":
                                    return h('Tag',{
                                        props:{
//                                      text:'启动中',
                                            type:'border',
                                            color:'success'
                                        },
                                    },'启动中')
                                    break;
                                case "closing":
                                    return h('Tag',{
                                        props:{
//                                      text:'关闭中',
                                            type:'border',
                                            color:'success'
                                        },
                                    },'关闭中')
                                    break;
                                default:
                                    break;
                            }
                        }

                    },
                    {
                        title:this.$t('Details'),
                        key:'',
                        align:'center',
                        // minWidth:140,
                        render:(h,params)=>{
                            let statics = params.row.overview;
                            let statusGroup = [];
                            if(JSON.stringify(statics) != "{}"){
                                for(let i in statics){
                                    statusGroup.push(h('span',{},this.paserTaskStatus(i)+':'+statics[i]))
                                }
                            }
                            return h('span',{},statusGroup)
                        }
                    },
                    {
                        title:this.$t('operation'),
                        key:'-',
                        align:'center',
                        // width:500,
                        minWidth:350,
                        maxWidth:350,
                        placement:'top-right',
                        action:true,
                        render:(h,params)=>{
                            let  _this = this;
                            let taskStatus = null
                            let taskBtnType = null
                            let btnStyle = null;
                            if(params.row.taskMode=="normal"){
                                btnStyle = "none"
                            }else{
                                btnStyle = "inline-block"
                            }
                            switch (params.row.status) {
                                case "initialized":
                                    taskStatus = "开始"
                                    taskBtnType = "success"
                                    break;
                                case "error":
                                case "failed":
                                    taskStatus = "开始"
                                    taskBtnType = "success"
                                    break;
                                case "running":
                                    taskStatus = "停止"
                                    taskBtnType = "error"
                                    break;
                                case "completed":
                                    taskStatus = "开始"
                                    taskBtnType = "success"
                                    break;
                                case "starting":
                                    taskStatus = "停止"
                                    taskBtnType = "error"
                                    break;
                                case "closing":
                                    taskStatus = "停止"
                                    taskBtnType = "error"
                                    break;
                                case "stop_error":
                                    taskStatus = "停止"
                                    taskBtnType = "error"
                                    break;
                                default:
                                    break;
                            }
                            return h("div",{
                                attrs:{
                                    class:'btnCenter'
                                }
                            },[
                                h('Poptip',{
                                    props:{
                                        confirm:true,
                                        title:"您确定要删除此任务吗？",
                                        transfer:true
                                    },
                                    on:{
                                        'on-ok':()=>{
                                            _this.deleteTask(params.row.id)
                                        },
                                        'on-cancel':()=>{

                                        }
                                    },
                                    style:{
                                        display:this.configMode === 1 ? 'none':'inline-block'
                                    }
                                },[
                                    h('Button',{
                                        props:{
                                            type:'text',
                                            size:'small',
                                            disabled:this.disabledAllBtn
                                        },
                                        attrs:{
                                            title:'删除'
                                        },
                                        style:{
                                            border:'none',
                                            background:'none',
                                            boxShadow:'none'
                                        },
                                    },[
                                        h('img', {
                                            attrs: {
                                                //                          src: !this.setReBtnStatus(params.row) ?require('../../../assets/globalIcon/del.png'):require('../../../assets/globalIcon/dis-del.png'),
                                                src:this.disabledAllBtn ? require('../../../../assets/project/delNote-d.png') : require('../../../../assets/project/delNote-h.png')
                                            },
                                            style: {
                                                cursor: 'pointer',
//				                            'margin-right':'5px',
                                                'vertical-align': 'middle',
//				                            width:'16px',
//				                            height:'auto',
                                                display:'inline-block',
                                                marginBottom:'4px',
                                            },
                                        }),
//				                    h('span',{
//				                        style: {
//				                            cursor: 'pointer',
//				//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
//											color:'#2d8cf0'
//				                        },
//				                    },'删除')
                                    ])]),
                                h('Button',{
                                    props:{
                                        type:"text",
                                        size:'small',
                                        disabled:this.disabledAllBtn
                                    },
                                    attrs:{
                                        title:'修改'
                                    },
                                    style:{
                                        border:'none',
                                        background:'none',
                                        boxShadow:'none',
                                        display:this.configMode === 1 ? 'none':'inline-block'
                                    },
                                    on:{
                                        click:()=>{
                                            _this.updateTask(params.row.id)
                                        }
                                    }
                                },[
                                    h('img', {
                                        attrs: {
                                            //                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
                                            src: this.disabledAllBtn ? require('../../../../assets/project/modifys.png') : require('../../../../assets/project/modifys-h.png')
                                        },
                                        style: {
                                            cursor: 'pointer',
//			                            'margin-right':'5px',
                                            'vertical-align': 'middle',
//			                            width:'16px',
//			                            height:'auto',
                                            display:'inline-block',
                                            marginBottom:'4px',
                                        },
                                    }),
//			                    h('span',{
//			                        style: {
//			                            cursor: 'pointer',
//			//                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
//										color:'#2d8cf0'
//			                        },
//			                    },'修改')
                                ]),
                                h('Poptip',{
                                    props:{
                                        confirm:true,
                                        title:"您确定要"+taskStatus+"此任务吗？",
                                        transfer:true
                                    },
                                    on:{
                                        'on-ok':()=>{
                                            _this.activeTask(params.row.id,taskStatus)
                                        },
                                        'on-cancel':()=>{

                                        }
                                    }
                                },[
                                    h('Button',{
                                        props:{
//                                  type:taskBtnType,
                                            type:'text',
                                            size:'small',
                                            disabled:this.disabledAllBtn
                                        },
                                        attrs:{
                                            title:taskStatus+'任务'
                                        },
                                        style:{
                                            border:'none',
                                            background:'none',
                                            boxShadow:'none',
                                            display:btnStyle
                                        },
                                    },[
                                        h('img', {
                                            attrs: {
                                                //                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
                                                src:taskStatus == '停止' ? (this.disabledAllBtn ? require('../../../../assets/scene/dis-stop-task.png') : require('../../../../assets/scene/stop-task.png')) : (this.disabledAllBtn ? require('../../../../assets/scene/dis-start-task.png') : require('../../../../assets/scene/start-task.png'))
                                            },
                                            style: {
                                                cursor: 'pointer',
                                                //			                            'margin-right':'5px',
                                                'vertical-align': 'middle',
                                                //			                            width:'16px',
                                                //			                            height:'auto',
                                                display:'inline-block',
                                                marginBottom:'4px',
                                            },
                                        }),
                                        h('span',{
                                            style: {
                                                cursor: 'pointer',
                                                //                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
                                                color:'#2d8cf0'
                                            },
                                        })//,taskStatus+'任务'
                                    ])]),
                                //     h('Poptip',{
                                //     props:{
                                //         confirm:true,
                                //         title:"您确定要初始化此任务吗？",
                                //     },
                                //     on:{
                                //         'on-ok':()=>{
                                //             _this.activeTask(params.row.id,"init")
                                //         },
                                //         'on-cancel':()=>{

                                //         }
                                //     }
                                // },[h('Button',{
                                //     props:{
                                //         type:"info",
                                //         size:'small'
                                //     },
                                //     style:{
                                //         margin:'5px'
                                //     },
                                //     },'初始化任务')]),
                                h('Button',{
                                    props:{
                                        type:"text",
                                        size:'small'
                                        // style:{margin:'10px'}
                                    },
                                    attrs:{
                                        title:'查看详情'
                                    },
                                    style:{
                                        border:'none',
                                        background:'none',
                                        boxShadow:'none'
                                    },
                                    on:{
                                        click:()=>{
                                            _this.taskDeail(params.row.id, params.row)
                                        }
                                    }
                                },[
                                    h('img', {
                                        attrs: {
                                            //                          src: !this.setReBtnStatus(params.row) ? require('../../../assets/globalIcon/modify.png'):require('../../../assets/globalIcon/dis-modify2.png'),
                                            src:require('../../../../assets/project/magnifier-h.png')
                                        },
                                        style: {
                                            cursor: 'pointer',
//			                            'margin-right':'5px',
                                            'vertical-align': 'middle',
//			                            width:'16px',
//			                            height:'auto',
                                            display:'inline-block',
                                            marginBottom:'4px',
                                        },
                                    }),
                                    h('span',{
                                        style: {
                                            cursor: 'pointer',
                                            //                          color:!this.setReBtnStatus(params.row) ? '#2d8cf0' : '#c5c8ce'
                                            color:'#2d8cf0'
                                        },
                                    })//,'查看详情'
                                ]),
                            ])
                        }

                    }
                ],

                taskData: [

                ],
                columnsVmList:[
                    {
                        type:'selection',
                        width:60,
                        align:'center'
                    },
                    {
                        title:'序号',
                        type:'index',
                        width:60,
                        align:'center'
                    },
                    {
                        title: this.type !== 7 ? '题目名称' : '任务名称',
                        key: this.type !== 7 ? 'name' : 'targetName',
                        align:'center',
//                  tooltip:true
                    },
//              {
//                  title:'子网络名',
//                  key:'networkName',
//                  align:'center'
//              },
                    {
                        title:'系统类型',
                        key:'sysType',
                        align:'center'
                    },
                    {
                        title:'IP',
                        key:'IP',
                        align:'center',
                        render:(h,params)=>{
                            let value = params.row.IP;
                            let oIP_ = [];
                            value.forEach((item,i)=>{
                                oIP_.push(h("p",{
                                    color:'#000',
                                },item))
                            })
                            return h("div",oIP_)
                        }
                    },
                    {
                        title:'服务端口',
                        key:'port',
                        align:'center',
                    },
                    {
                        title:this.$t('Add'),
                        key:'add',
                        align:'center',
                        width:80,
                        render:(h,params) =>{
                            let _this = params;
                            return h('Button', {
                                props: {
                                    type: 'primary',
                                    disabled:params.row._disabled
                                },
                                on:{
                                    click: (e) => {
                                        if(this.selectedVmDataTable.indexOf(this.type !== 8 ? _this.row.id : `${_this.row.id},${_this.row.port}`)!=-1){
                                            this.$Message.info("已添加")
                                            return;
                                        }
                                        let port = this.formValidate.serverPort
                                        if (port !== '' && this.portInputDisabled) {
                                            if (params.row.port !== port) {
                                                this.$Message.info(`${params.row.name}端口不同，无法添加`)
                                                return
                                            }
                                        }
                                        if (this.portInputDisabled) {
                                            this.formValidate.serverPort = params.row.port
                                        }
                                        let vms = this.dataVmList.filter(vm => vm.questionId == _this.row.questionId);
                                        vms.forEach(vm => {
                                            if(this.selectedVmDataTable.indexOf(this.type !== 8 ? vm.id : `${vm.id},${vm.port}`)!=-1){
                                                return;
                                            }
                                            this.addVmAfterTable(vm)
                                            this.selectedVmDataTable.push(this.type !== 8 ? vm.id : `${vm.id},${vm.port}`)
                                            this.formValidate.selectedVmData.push({
                                                "name":vm.name,
                                                "targetName": vm.targetName,
                                                "id":vm.id,
                                                "questionId":vm.questionId,
                                                "port": vm.port
                                            })
                                        })
                                    },
                                }
                            }, "+");
                        }
                    }
                ],
                targetList:[],
                dataVmList:[],
                selectedVmDataTable:[

                ],
                configurationData:[

                ],
                createFlagTaskModalLoading:true,
                showBorder: false,
                showStripe: true,
                showHeader: true,
                showIndex: true,
                showCheckbox: false,
                fixedHeader: false,
                tableSize: 'small',
                createFlagTaskModal : false,
                formValidate: {
                    name: '',
                    configer: '',
                    Profile:'',
                    osInfo:'',
                    type:'',
                    configContent:'',
                    selectedVmData:[

                    ],
                    desc: '',
                    vmName:'',
                    vmIP:'',
                    taskMode:'preset',
                    expireTime:180,
                    serverPort:''
                },
                ruleValidate: {
                    name: [
                        { required: true, message: '', trigger: 'change',validator:validateName }
                    ],
                    configer: [
                        { required: true, message: '请选择配置', trigger: 'change'},
                    ],
                    selectedVmData:[
                        {required:true ,message:"请选择虚拟机"}
                    ],
//              taskMode: [
//                 { required: true, message: '', trigger: 'change'}
//              ],
                    expireTime: [
                        { validator: validateCycle, trigger: 'change'}
                    ],
                    serverPort:[
                        { validator: validatePort, trigger: 'change' }
                    ],
                },
                vmCurrentPage:1,
                vmItemPage:100000,
                vmTotal:0,
                taskCurrentPage:1,
                taskItemPage:10,
                taskTotal:0,
                judgePanelType:true,//判断是修改还是保存
                workingAreaTaskId:"",//存放修改的任务id

                //查看详情面板
                taskDeailModal:false,
                taskDeailColumns:[
                    {
                        type:"expand",
                        width:'30',
                        render: (h, params) => {
                            return h('div',{},[
                                h('Row',{props:{class:'expand-row'}},[
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'宿主机名称:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.host)
                                    ]),
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'宿主机ip:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.hostIp)
                                    ]),
                                ]),
                                h('Row',{props:{class:'expand-row'}},[
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'实例名称:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.instance)
                                    ]),
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'ip:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.IP)
                                    ]),
                                ]),
                                h('Row',{props:{class:'expand-row'},},[
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'cidr:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.cidr)
                                    ]),
                                    h('Col',{props:{span:'8'},style:{width:'50%'}},[
                                        h('span',{props:{class:'expand-key'}},'网络名称:  '),
                                        h('span',{props:{class:'expand-value'}},params.row.networkName)
                                    ]),
                                ]),
                            ])
                        }
                    },
                    {
                        title:this.$t('name'),
                        key:'deviceName',
                        align:'center'
                    },
                    {
                        title:this.$t('Status'),
                        key:'status',
                        align:'center',
                        render:(h,params)=>{
                            return h('span',{}, this.paserTaskStatus(params.row.status))
                        }
                    },
                    {
                        title:this.$t('CTime'),
                        key:'created',
                        align:'center'
                    },
//              {
//                  title:this.$t('LastUpdate'),
//                  key:'updated',
//                  align:'center'
//              },
                    {
                        title:this.$t('Message'),
                        key:'message',
                        align:'center'
                    },
//              {
//                  title:this.$t('operation'),
//                  key:'-',
//                  align:'center',
//                  render:(h,params)=>{
//                      let $this = this
//                      return h("Button",{
//                          props:{
//                              type:'primary'
//                          },
//                          on:{
//                              click(){
//                                  let configId = "";
//                                  for(let i = 0;i<$this.taskData.length;i++){
//                                      if($this.taskData[i].id==params.row.taskId){
//                                          // alert('-')
//                                          // c
//                                          configId = $this.taskData[i].configId
//                                          window.open("/TopoLeftFeatures/index.html#/collectTaskResults?vmName="+params.row.deviceName+"&vmId="+params.row.deviceId+"&configId="+configId+"&taskCreateTime="+params.row.created);
//                                          return false;
//                                      }
//                                  }
//
//                              }
//                          }
//                      },"查看结果")
//                  }
//              }
                    {
                        title: '检测是否通过',
                        align:'center',
                        render:(h,params)=>{
                            let { status, metadata } = params.row
                            if (!['running'].includes(status)) {
                                return h('span', '-')
                            }
                            let metadataObj
                            try {
                                metadataObj = JSON.parse(metadata)
                            } catch (e) {
                                return h('span', '-')
                            }
                            return h('span', metadataObj.pass ? '通过' : '未通过')
                        }
                    }
                ],
                taskDeailData:[],
                setintervalTime:setInterval(() => {

                }, 1000),
                profileValue:'',

                optionHoverEvent:null,
                optionOutEvent:null,
                configurationInformation:false,
                cardPanelLeft:'3px',
                cardPanelTop:'3px',
                configPanel:{
                    configPath:'',
                    configSystype:'',
                    configContent:'',
                    configDescription:'',
                    configCreateTime:'',
                    configCreatorName:'',
                    configName:'',
                    configType:'',
                    configArg:'',
                    configCmd:'',
                    protocol:'',
                    serverPort:'',
                    language:'',
                },
                hoverCdraBol:false,
                boxShadow:'5px 5px 5px #ddd',
                configerParams:false,//回显配置详细信息
                metadataConfigerInfor:null,
                currentSceneId:'',
                propertiesData:[],
                vmAttributeData:[],
                deviceList:[],
                currentDevice:[],//设备数据
                peopleValue:[],//人员数据
                currentUsers:[],//保存时数据
                getNameFormId:{},//id和名称对应集合
                userDeciceGroupId:[],//判断是否已经存在
                currentTaskMode:'preset',
                disabledTepBol:false,
                subnetList:[]
            }
        },
        //props: ['headerData'],
        created(){
            //this.tableHeight = $(window).height() - 224 ;
            // this.tableHeight = '200px';
            this.currentProjectId = this.$route.query.prjid
            this.currentSceneId = this.$route.query.id
            //  this.currentProjectId = "8879b3075da84a0892e1ecc146e8f593"
            //获取工程详情
            getstatusbyprjid(this.$route.query.prjid).then(data => {
                if(data.code == 1){
                    this.projectInfo = data.attribute;
                    this.getProjectSubnet();
                }
            })
            //获取演练详情，设置周期
            getSceneInfo(this.currentSceneId).then(data => {
                if(data.code == 1){
//      		this.formValidate.expireTime = JSON.parse(data.data.extension).cycleTime*60;
//      		this.expireTime = JSON.parse(data.data.extension).cycleTime*60;
                    this.expireTime = 180;
                }
            })
            this.getTaskList({
                "testId":this.currentSceneId,
                "page":this.taskCurrentPage,
                "rows":this.taskItemPage,
                "taskType":this.taskTypeTable,
                "taskMode":this.currentTaskMode,
                // "node":"true",
            });
            this.refreshVmList();
            // this.currentProjectId = this.$route.params.username
            // this.currentProjectId = this.$route.query.projectId
            // alert(this.currentProjectId)
            // this.getModelWidth();
            // alert(this.panelWidth)
        },
        computed: {
            // getModelWidth: function () {
            //     this.panelWidth = $(window).width()*0.5
            // }
            showDataVmList(){
                let arr = [];
                let idArr = [];
                this.dataVmList.forEach((item,index) => {
                    if(!idArr.includes(item.questionId)){
                        arr.push(item);
                        idArr.push(item.questionId);
                    }
                })
                return arr;
            },
            showSelectedVmData(){
                let arr = [];
                let idArr = [];
                this.formValidate.selectedVmData.forEach((item,index) => {
                    if(item.questionId && !idArr.includes(item.questionId)){
                        arr.push(item);
                        idArr.push(item.questionId);
                    }
                })
                return arr;
            },
            disabledPort(){
                let template = this.configurationData.find(item => item.id === this.formValidate.configer)
                let scriptName = template ? template.name : ''
                let portInputDisabled = (scriptName && scriptName.includes('检查ip端口')) || false
                this.portInputDisabled = portInputDisabled
                return this.portInputDisabled
            },
        },
        methods: {
            getMsgFormSon(data){
                this.propertiesData = data;
            },
            configeManage(){
                this.taskConfigerMess = true;
                this.$refs.outband.getOutbandcaptureInfoList()
                this.$refs.outband.getSysType()
            },
            clickEvent: function(){
                // this.$emit("success",this.taskTypeTableTitle)
                // this.loadConfiguration(this.taskTypeTable)
                this.loadConfiguration("outband_capture")
            },
            handleSelectAll (status) {
                this.$refs.selection.selectAll(status)
            },
            // 一键配置端口检测
            configuringPortDetection() {
                Promise.all([loadConfiguration({
                    name: '检查ip端口'
                }), queryVmWithParty(this.$route.query.prjid, {
                    page: 1,
                    pageSize: 2147483646,
                    projectId:this.currentProjectId,
                    order:"asc",
                    sortBy:"name",
                    profile:this.profileValue,
                    findPorts:true
                }), this.getTargetTeamList()]).then(([scriptRes, vmRes, targetList]) => {
                    if (scriptRes.code === 1 && vmRes.code === 1) {
                        // 查询是否存在检查ip端口的配置
                        let scriptList = scriptRes.data.items || []
                        if (scriptList.length === 0) { // 没有该配置，终止操作
                            this.$Message.info('没有ip端口检测，无法一键配置')
                            return
                        }
                        let script = scriptList.find(item => item.name === '检查ip端口') || {}
                        // 查询已经分配的靶标
                        let targetIds = targetList.map(target => target.vmId);
                        // 获取分配的靶标对应的虚拟机，根据题目ID去重虚拟机
                        let idArr = [];
                        let quetionList = [];
                        let vmList = vmRes.data.list || []
                        vmList.forEach(item => {
                            if(targetIds.includes(item.id)){ // 已分配的虚拟机
                                let findTargetList = targetList.filter(target => target.vmId == item.id)
                                findTargetList.forEach(target => {
                                    let questionId = target.questionId;
                                    this.$set(item, 'questionId', questionId)
                                    if(!idArr.includes(questionId)){ // 未包含在题目列表中的数据添加进去
                                        quetionList.push({
                                            questionId: questionId,
                                            name: ![7, 8].includes(this.type) ? item.name : target.targetName,
                                            port:([1, 4, 7, 8, 9].includes(this.type)) ? target.servicePort :
                                                (this.type == 2 ? target.url.split(':')[1] : target.port),
                                            imageId: target.imageId
                                        });
                                        idArr.push(questionId);
                                    }
                                })
                            }
                        })
                        // 针对题目一键创建IP端口检测任务
                        let promiseList = []
                        quetionList.forEach(item => {
                            let vms = vmList.filter(subItem => {
                                // 攻防赛plus存在多个题目共用一个虚拟机的情况，需要通过镜像来识别判断
                                return this.type === 8 ? subItem.imageId === item.imageId : subItem.questionId === item.questionId
                            }).map(subItem => subItem.id)
                            promiseList.push(saveoutbandTask({
                                name: item.name,
                                description: '',
                                deviceData: vms.map(vmId => {
                                    return {
                                        deviceId:vmId,
                                        deviceType:"VM"
                                    }
                                }),
                                deviceIdList : vms,
                                deviceType: "VM",
                                taskType:this.taskTypeTable,
                                taskMode: 'preset',
                                testId:this.currentSceneId,
                                metadata:{
                                    scriptId: script.id,
                                    interval: 180,
                                    serverPort: item.port
                                },
                                properties: {}
                            }))
                        })
                        Promise.all(promiseList).then(res => {
                            let list = res.filter(item => item.code !== 1) || []
                            if (list.length === 0) {
                                this.$Message.info('一键配置ip端口检测成功')
                            } else {
                                this.$Message.warning('一键配置ip端口检测失败')
                            }
                            this.getTaskList({
                                "testId":this.currentSceneId,
                                "page":this.taskCurrentPage,
                                "rows":this.taskItemPage,
                                "taskType":this.taskTypeTable,
                                "taskMode":this.currentTaskMode,
                            });
                        })
                    } else {
                        if (scriptRes.code !== 1) {
                            this.$Message.warning(scriptRes.message)
                        }
                        if (vmRes.code !== 1) {
                            this.$Message.warning(vmRes.message)
                        }
                    }
                }).catch(() => {
                    this.$Message.error('一键配置ip端口检测异常');
                })
            },
            createFlagTask(){
                this.judgePanelType = true
                this.$refs['formValidate'].resetFields();
                this.vmCurrentPage = 1
                this.vmItemPage = 100000
                this.formValidate.configer = "";
                this.formValidate.vmName = "";
                this.formValidate.vmIP = "";
                this.profileValue = "";
                this.configurationData = [];
                this.formValidate.expireTime = this.expireTime;
                this.formValidate.serverPort = '';
                this.judgeVmStatus()
                this.loadConfiguration("outband_capture")
                this.$refs.store.clearSingleSelect()
                this.createFlagTaskModal = true;
                // this.formValidate.name = "";
                this.propertiesData = [{
                    key:null,
                    value:null,
                }];
                this.formValidate.taskMode = "preset";
                this.formValidate.desc = ""
                // this.selectedVmDataTable = []
                this.selectedVmDataTable = []
                this.formValidate.selectedVmData = []
            },
            ok(){
                this.handleSubmit('formValidate')
            },
            cancel(){
                //  this.$Message.info('Clicked cancel')
            },
            handleSubmit (name) {
                let $this = this;
                this.properties = {};
                if(this.propertiesData.length!=0){
                    let attrData = $this.propertiesData;
                    for (let index = 0; index < attrData.length; index++) {
                        const element = attrData[index];
                        if(element.key){
                            $this.properties[element.key] = element.value;
                        }
                    }
                }
                $this.$refs[name].validate((valid) => {
                    if (valid) {
                        // $this.$Message.success('Success!');
                        if($this.selectedVmDataTable.length!=0){
                            if($this.judgePanelType){//判断是保存还是修改
                                $this.saveoutbandTask({
                                    name:$this.formValidate.name,
                                    // configName:$this.configPanel.configName,
                                    // configId:$this.formValidate.configer.split('-')[0],
                                    description :$this.formValidate.desc,
                                    deviceData:$this.selectedVmDataTable.map(vmId => {
                                        return {
                                            deviceId: this.type !== 8 ? vmId : vmId.split(',')[0],
                                            deviceType:"VM"
                                        }
                                    }),
                                    deviceIdList: this.type !== 8 ? $this.selectedVmDataTable : $this.selectedVmDataTable.map(item => item.split(',')[0]),
                                    deviceType:"VM",
                                    taskType:$this.taskTypeTable,
                                    taskMode:$this.formValidate.taskMode,
                                    testId:$this.currentSceneId,
                                    metadata:{
                                        scriptId:$this.formValidate.configer,
                                        interval:Number($this.formValidate.expireTime),
                                        serverPort:$this.formValidate.serverPort
                                    },
                                    properties:$this.properties,
                                })
                            }else{
                                $this.amendTask({
                                    name:$this.formValidate.name,
                                    // configName:$this.configPanel.configName,
                                    // configId:$this.formValidate.configer.split('-')[0],
                                    description :$this.formValidate.desc,
                                    deviceData:$this.selectedVmDataTable.map(vmId => {
                                        return {
                                            deviceId: this.type !== 8 ? vmId : vmId.split(',')[0],
                                            deviceType:"VM"
                                        }
                                    }),
                                    deviceIdList: this.type !== 8 ? $this.selectedVmDataTable : $this.selectedVmDataTable.map(item => item.split(',')[0]),
                                    deviceType:"VM",
                                    taskType:$this.taskTypeTable,
                                    taskMode:$this.formValidate.taskMode,
                                    testId:$this.currentSceneId,
                                    metadata:{
                                        scriptId:$this.formValidate.configer,
                                        interval:Number($this.formValidate.expireTime),
                                        serverPort:$this.formValidate.serverPort
                                    },
                                    properties:$this.properties,
                                })
                            }

                        }else{
                            $this.$Message.info("请选择虚拟机")
                            $this.createFlagTaskModalLoading = false;
                            $this.$nextTick(() => {
                                $this.createFlagTaskModalLoading = true;
                            });
                        }

                    } else {
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                    }

                });
            },
            handleReset (name) {
                this.$refs[name].resetFields();
            },
            addVmAfterTable(param){
                let data = this.dataVmList;
                this.dataVmList.forEach(function(item,i){
                    if(item.id==param.id && item.port === param.port){
                        item._checked = true;
                        item._disabled = true;
                    }
                })
            },
            handleClose2 (event, name) {
                let $this = this;
                let questionId = name;
                let questionVms = this.dataVmList.filter(vm => vm.questionId == questionId);//题目虚拟机
                let questionVmsIds = questionVms.map(vm => this.type !== 8 ? vm.id : `${vm.id},${vm.port}`);
                let data = this.formValidate.selectedVmData;
                let data1 = JSON.parse(JSON.stringify(this.formValidate.selectedVmData));
                $this.selectedDataConfiger = [];
                let _data = this.selectedVmDataTable;
                data1.forEach((item,i) => {
                    if(item){
                        if(questionVmsIds.includes(this.type !== 8 ? item.id : `${item.id},${item.port}`)){
                            let datai =  data.findIndex(vm => {
                                if (this.type !== 8) {
                                    return item.id == vm.id
                                } else {
                                    return item.id == vm.id && item.port == vm.port
                                }
                            });
                            data.splice(datai,1);
                            let _datai = $this.selectedVmDataTable.findIndex(vmId => {
                                if (this.type !== 8) {
                                    return item.id == vmId
                                } else {
                                    let list = vmId.split(',')
                                    return item.id == list[0] && item.port == list[1]
                                }
                            });
                            _data.splice(_datai,1);
                            //_data.remove(name);
                            $this.judgeVmStatus()
                        }
                    }
                });
                this.formValidate.selectedVmData = data;
                if (this.portInputDisabled && data.length === 0) {
                    this.formValidate.serverPort = ''
                }
                // const index = this.selectedVmData.indexOf(name);
                // this.count.splice(index, 1);
            },
            judgeVmStatus(){
                let data = this.dataVmList;
                let data_ = this.selectedVmDataTable
                data.forEach((item,i) =>{
                    if(data_.indexOf(this.type !== 8 ? item.id : `${item.id},${item.port}`)!=-1){
                        // alert('-')
                        item._checked = true;
                        item._disabled = true;
                    }else{
                        item._checked = false;
                        item._disabled = false;
                    }
                })
            },
            loadConfiguration(operation){
                let $this= this;
//          axios({
//                url:'checker/scripts?pageIndex=1&pageSize=100000',
//            })
                let params = {
                    pageIndex :1,
                    pageSize:100000
                }
                loadConfiguration(params).then((response)=>{
                    if(response.code==1||response.code==0){
                        $this.configurationData = response.data.items;
                        // let ConfigurationList = response.data.items;
                        // if(ConfigurationList==""){
                        //     return;
                        // }
                        // $.each(ConfigurationList, function(i,item) {
                        //     // let profile = "";
                        //     // if(item.data){
                        //     //     profile = item.data.profile;
                        //     // }
                        //     $this.configurationData.push({
                        //         name:item.name,
                        //         id:item.id,
                        //     })
                        // });
                    }else{
                        $this.$Message.error(response.prompt)
                    }
                })
            },
            getTargetTeamList(){
                return new Promise((resolve,reject) => {
                    let params = {
                        pageIndex:1,
                        pageSize:2147483647,
                        sceneId:this.$route.query.id,
//					projectId:this.$route.query.prjid
                    }
//		  		getTargetTeamList_new(params).then(data => {
                    if([1, 4, 7, 8, 9].includes(this.type)){
                        queryTargetAllot(params).then(data => {
                            if(data.code==1){
                                let targetList = data.data.items || data.data;
                                resolve(targetList);
                            }else{

                            }
                        })
                    }else if(this.type == 2){ // 夺旗赛要额外查询备用环境的分配情况
                        queryCtfTargetAllot(Object.assign(params, { tag: '1' })).then(data => {
                            if(data.code==1){
                                let targetList = data.data.items || data.data;
                                resolve(targetList.filter(target => target.vmId));
                            }else{

                            }
                        })
                    }
                })
            },
            getProjectSubnet(){
                queryNetworkList(this.$route.query.prjid,this.projectInfo.network.id).then(data => {
                    if(data.code == 1){
                        let subnetList = [];
                        let linkList = [];
                        data.attribute.editorStage.childs.forEach(item => {
                            subnetList = subnetList.concat(item.childs);
                            if(item.links){
                                linkList = linkList.concat(item.links);
                            }
                        })
                        this.subnetList = subnetList.filter(subnet => subnet.dataType == 'NW');
//	    			this.subnetList.forEach(subnet => {
//	    				let ip;
//	    				if(this.type == 1){
//	    					if(linkList.filter(link => link.bNetid == subnet.id).length > 0){
//	    						ip = linkList.filter(link => link.bNetid == subnet.id)[0].bIpv4;
//	    					}
//	    				}
//						this.idwithName[subnet.id] = {
//							id:subnet.id,
//							name:subnet.name,
//							ip:ip
//						}
//					})
                    }
                })
            },
            getVmList(getParamObj){
                let $this = this;
                queryVmWithParty(this.$route.query.prjid,getParamObj).then((response)=>{
                    if(response.code==1){
                        let vmData = response.data.list;
                        $this.vmTotal = Number(response.data.count);
                        let disabled_ = false;
                        let checked_ = false;
                        let index = 0;
                        this.getTargetTeamList().then(targetList => {
                            let ret = []
                            //$this.targetList = targetList;
                            $this.formValidate.selectedVmData.forEach(vm => {
                                let target = targetList.filter(target => target.vmId == vm.id)
                                if(target.length > 0){
                                    this.$set(vm,'questionId',target[0].questionId)
                                }
                            })
                            let targetIds = targetList.map(target => target.vmId);
                            vmData.forEach((item,i) => {
                                if($this.selectedVmDataTable.length!=0){
                                    let target = targetList.find(target => {
                                        return target.vmId == item.id
                                    }) || {}
                                    if($this.selectedVmDataTable.indexOf(this.type !== 8 ? item.id : `${item.id},${target.servicePort}`)!=-1){
                                        disabled_ = true
                                        checked_ = true
                                    }else{
                                        disabled_ = false
                                        checked_ = false
                                    }
                                }else{
                                    disabled_ = false
                                    checked_ = false
                                }
                                if(targetIds.includes(item.id)){
                                    let targetist = targetList.filter(target => target.vmId == item.id)
                                    if ($this.type !== 8) {
                                        let target = targetist[0];
                                        let questionId = target.questionId;
                                        ret.push({
                                            name: item.name,
                                            targetName: target.targetName,
                                            id:item.id,
                                            sysType:item.sysType,
                                            questionId:questionId,
                                            port:([1, 4, 7, 8, 9].includes($this.type)) ? target.servicePort : ($this.type == 2 ? target.url.split(':')[1] : target.port),
                                            networkName:item.networkName,
                                            profile:item.profile = item.profile ? item.profile :'',
                                            IP:item.address.map((item)=>item.ips.map(ip => ip.ipAddress).join(',')),
                                            _disabled: disabled_,
                                            _checked:checked_,
                                        })
                                    } else {
                                        targetist.forEach(target => {
                                            let questionId = target.questionId;
                                            ret.push({
                                                name: target.targetName,
                                                targetName: target.targetName,
                                                id:item.id,
                                                sysType:item.sysType,
                                                questionId:questionId,
                                                port:([1, 4, 7, 8, 9].includes($this.type)) ? target.servicePort : ($this.type == 2 ? target.url.split(':')[1] : target.port),
                                                networkName:item.networkName,
                                                profile:item.profile = item.profile ? item.profile :'',
                                                IP:item.address.map((item)=>item.ips.map(ip => ip.ipAddress).join(',')),
                                                _disabled: disabled_,
                                                _checked:checked_,
                                            })
                                        })
                                    }
                                }else{
                                }
                            })
                            $this.dataVmList = ret;
                        })
                    }else{
                        $this.dataVmList = [];
                        $this.$Message.error(response.message)
                    }
                })
            },
            switchineVmCurrentPage(numberPage){
                this.vmCurrentPage = numberPage;
                this.refreshVmList();
            },
            switchVmItemPage(numberSize){
                this.vmItemPage = numberSize
                this.refreshVmList();
            },
            saveoutbandTask(saveDateJson){
                let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process+"custom/tasks",
//              method:'post',
//              data:saveDateJson
//          })  
                saveoutbandTask(saveDateJson).then((response)=>{
                    if(response.code==1){
                        $this.createFlagTaskModal = false;
                        $this.$Message.success('添加任务成功');
                        // 添加成功后清空搜索条件，回退到首页
                        $this.taskCurrentPage = 1
                        $this.getTaskList({
                            "testId":$this.currentSceneId,
                            "page":$this.taskCurrentPage,
                            "rows":$this.taskItemPage,
                            "taskType":$this.taskTypeTable,
                            "taskMode":$this.currentTaskMode,
                            // "node":"false",
                        })
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                        //$this.$parent.getStatisticsList();
                    }else{
                        $this.$Message.error(response.message)
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                    }
                })
            },
            getTaskList(obj){
                let $this = this;
                clearTimeout($this.headerData.serintervalTimeFun)
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks?"+this.BASE.getParamStr(obj),
//          })
                getTaskList(obj).then((response)=>{
                    if(response.code==1){
                        $this.taskData = [];
                        $this.taskTotal = response.data.total;
                        let setintrvalBol = false
                        // let _s = 0,_e = 0,_i = 0,_r = 0,stintervalBol = false;
                        if(response.data.items.length!=0){
                            $this.taskData = response.data.items.map((item)=>{
                                if($this.selectedData.map((item)=>item.id).join(',').indexOf(item.id)!=-1){
                                    item['_checked'] = true;
                                }else{
                                    item['_checked'] = false;
                                }
                                return item;
                            });
                            response.data.items.forEach(function(item,i){
                                if(item.status=="running"||item.status=="starting"||item.status=="closing"){
                                    setintrvalBol = true;
                                }
                            })
                        }
                        if(setintrvalBol){
                            $this.headerData.serintervalTimeFun  = setTimeout(() => {
                                $this.getTaskList({
                                    "testId":$this.currentSceneId,
                                    "page":$this.taskCurrentPage,
                                    "rows":$this.taskItemPage,
                                    "taskType":$this.taskTypeTable,
                                    "taskMode":$this.currentTaskMode,
                                    // "node":"false",
                                });
                            }, 2000);

                        }else{
                            clearTimeout($this.headerData.serintervalTimeFun)
                            // $this.setintervalTaskList();
                        }
                        // $this.getTaskListDeailData()
                        // $this.$emit("success",$this.taskTypeTableTitle+'-'+_s+'-'+_e+'-'+_i+'-'+_r+'-'+stintervalBol+'-'+$this.taskCurrentPage+'-'+$this.taskItemPage)
                    }else if(response.code==-2){

                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            },
            switchineTaskCurrentPage(numberPage){
                this.taskCurrentPage = numberPage;
                this.getTaskList({
                    "testId":this.currentSceneId,
                    "page":this.taskCurrentPage,
                    "rows":this.taskItemPage,
                    // "configType":"",
                    "taskType":this.taskTypeTable,
                    "taskMode":this.currentTaskMode,
                })
            },
            switchTaskItemPage(numberSize){
                this.taskItemPage = numberSize
                this.getTaskList({
                    "testId":this.currentSceneId,
                    "page":this.taskCurrentPage,
                    "rows":this.taskItemPage,
                    // "configType":"",
                    "taskType":this.taskTypeTable,
                    "taskMode":this.currentTaskMode,
                })
            },
            deleteTask(taskId){
                let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId,
//              method:'delete'
//          })
                deleteTask(taskId).then((response)=>{
                    if(response.code==1){
                        if(response.data[0].code==1){
                            // 删除后展示当前页，当前页没有数据展示前一页
                            this.taskCurrentPage = (this.taskData.length == 1 && this.taskCurrentPage > 1) ?
                                this.taskCurrentPage - 1 : this.taskCurrentPage;
                            $this.getTaskList({
                                "testId":$this.currentSceneId,
                                "page":$this.taskCurrentPage,
                                "rows":$this.taskItemPage,
                                "taskType":$this.taskTypeTable,
                                "taskMode":$this.currentTaskMode,
                            })
                            $this.$Message.success("删除成功")
                            //$this.$parent.getStatisticsList();
                        }else{
                            $this.$Message.error(response.data[0].message)
                        }

                    }else{
                        $this.$Message.error(response.data[0].message)
                    }
                })
            },
            updateTask(taskId){
                this.judgePanelType = false
                this.formValidate.vmName = "";
                this.formValidate.vmIP = "";
                let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId,
//          })
                taskDetail(taskId).then(async (response)=>{
                    if(response.code==1){
                        $this.workingAreaTaskId = response.data.id
                        $this.selectedVmDataTable = []
                        $this.formValidate.selectedVmData = []
                        $this.createFlagTaskModal = true;
                        $this.propertiesData = [];
                        $this.formValidate.name = response.data.name;
                        $this.formValidate.desc = response.data.description;
                        $this.formValidate.configer = response.data.metadata.scriptId;
                        let template = this.configurationData.find(item => item.id === response.data.metadata.scriptId)
                        let scriptName = template ? template.name : ''
                        this.portInputDisabled = (scriptName && scriptName.includes('检查ip端口')) || false
                        $this.formValidate.serverPort = response.data.metadata.serverPort;
                        $this.formValidate.expireTime = response.data.metadata.interval;
                        $this.formValidate.taskMode = response.data.taskMode;
                        if(response.data.deviceData.length!=0){
                            let mytargetList = []
                            if (this.type === 8) {
                                await this.getTargetTeamList().then(targetList => {
                                    mytargetList = targetList
                                })
                            }
                            response.data.deviceData.forEach((item,i) => {
                                let targetName
                                if ($this.type === 7) { // 综合演练需要查询出任务名称
                                    targetName = ($this.dataVmList.find(vm => vm.id === item.deviceId) || {}).targetName
                                }
                                let target = mytargetList.find(target => target.vmId == item.deviceId) || {}
                                $this.selectedVmDataTable.push(this.type !== 8 ? item.deviceId : `${item.deviceId},${target.servicePort}`);
                                $this.formValidate.selectedVmData.push({
                                    name:item.deviceName,
                                    id:item.deviceId,
                                    targetName,
                                    "port": target.servicePort,
                                    questionId: target.questionId
                                })
                            })
                        }
                        $this.loadConfiguration();
                        $this.formValidate.taskMode = response.data.taskMode;
                        if(JSON.stringify(response.data.properties)!="{}"){
                            for(let i in response.data.properties){
                                let obj = {};
                                obj['key'] = i;
                                obj['value'] = response.data.properties[i];
                                $this.propertiesData.push(obj)
                            }
                        }
                    }else{
                        $this.workingAreaTaskId = ""//清空任务id
                        $this.$Message.error(response.message)
                    }
                }).then(()=>{
                    $this.loadConfiguration("outband_capture")
                    this.refreshVmList();
                    $this.judgeVmStatus()
                })
            },
            amendTask(amendTaskData){
                let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process+"custom/tasks/"+this.workingAreaTaskId,
//              method:'put',
//              data:amendTaskData
//          })
                amendTask(this.workingAreaTaskId,amendTaskData).then((response)=>{
                    if(response.code==1){
                        $this.createFlagTaskModal = false;
                        $this.$Message.success("修改成功");
                        $this.getTaskList({
                            "testId":$this.currentSceneId,
                            "page":$this.taskCurrentPage,
                            "rows":$this.taskItemPage,
                            "taskType":$this.taskTypeTable,
                            "taskMode":$this.currentTaskMode,
                        })
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                    }else{
                        $this.$Message.error(response.message)
                        $this.createFlagTaskModalLoading = false;
                        $this.$nextTick(() => {
                            $this.createFlagTaskModalLoading = true;
                        });
                    }
                })
            },
            activeTask(taskId,active){
                let $this = this
                if(active=="开始"){
                    active = "start"
                }else if(active=="停止"){
                    active = "stop"
                }
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId+'/execute?operation='+active,
//              method:'post'
//          })
                activeTask(taskId,active).then((response)=>{
                    let activeType;
                    if(response.code==1){
                        $this.$Message.success(`${active === 'start' ? '开始' : '停止'}任务成功`)
                        $this.getTaskList({
                            "testId":$this.currentSceneId,
                            "page":$this.taskCurrentPage,
                            "rows":$this.taskItemPage,
                            "taskType":$this.taskTypeTable,
                            "taskMode":$this.currentTaskMode,
                        });
                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            },
            taskDeail(taskId, obj){
                let $this = this
                let deviceData = obj.deviceData || []
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks/"+taskId+'/histories',
//          })
                taskDetailHis(taskId).then((response)=>{
                    if(response.code==1){
                        $this.taskDeailData = [];
                        $this.taskDeailModal = true
                        // $this.taskDeailData= reponse.data;
                        response.data.forEach((item,i) => {
                            let findItem = deviceData.find(sub => sub.id === item.id) || {}
                            $this.taskDeailData.push({
                                id:item.id,
                                deviceName:item.deviceName,
                                taskId:item.taskId,
                                status:item.status,
                                message:item.message,
                                deviceId:item.deviceId,
                                IP:'',
                                host:'',
                                hostIp:'',
                                instance:'',
                                osId:'',
                                cidr:'',
                                created:item.created ? item.created:'',
                                updated:item.updated ? item.updated:'',
                                metadata: findItem.metadata,
                                _expanded:false
                            })
                        })
                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            },
            deleteManyTask(selection){
                let $this = this;
                if(this.selectedData.length==0){
                    this.$Message.error("请选择要删除的任务")
                }else{
//              axios({
//                  url:this.GLOBAL._projPath_process +"custom/tasks/"+this.selectedData.map((item)=>item.id).join(','),
//                  methods:'delete'
//              })
                    deleteManyTask(this.selectedData.map((item)=>item.id).join(',')).then((response)=>{
                        if(response.code==1){
                            response.data.forEach(function(item,i){
                                if(item.code==1){
                                    $this.$Message.success("删除成功")
                                }else{
                                    $this.$Message.error(item.message)
                                }
                            })
                            $this.getTaskList({
                                "testId":$this.currentSceneId,
                                "page":$this.taskCurrentPage,
                                "rows":$this.taskItemPage,
                                "taskType":$this.taskTypeTable,
                                "taskMode":$this.currentTaskMode,
                            })
                        }else{
                            $this.$Message.error(response.message)
                        }
                    })
                }
            },
            getSelectedTableItem(selection){
                this.selectedData = [];
                this.selectedData = selection

            },
            hostDeail(row){
                let $this  = this;
                if(!row._expanded){
//              axios({
//                  url:this.GLOBAL._projPath_deploy+"project/servers/"+row.deviceId,
//              })
                    hostDetail(row.deviceId).then((response)=>{
                        if(response.code==1){
                            $this.taskDeailData.forEach(function(item,i){
                                if(row.id==item.id){
                                    item._expanded = true
                                    item.host = response.data.host;
                                    item.hostIp = response.data.hostIp;
                                    item.instance = response.data.instanceName;
                                    item.osId= response.data.cloudId;
                                    item.networkName = response.data.networkName;
                                    item.IP = response.data.addresses.map((item)=> item.ips.map(ip => ip.ipAddress).join(','))
                                    item.cidr = response.data.addresses.map((item)=> item.ips.map(ip => ip.cidr).join(','))
                                    // item.created = reponse.data.created ? reponse.data.created : ''
                                    // item.updated = reponse.data.updated ? reponse.data.updated : ''
                                    return false;
                                }
                            })
                        }
                    })
                }else{
                    row._expanded = !row._expanded;
                }
            },
            // setintervalTaskList(obj){
            //     let $this = this;
            //     $.ajax({
            //         type:"get",
            //         url:_projPath_process +"custom/tasks?"+GlobalTool.getParamStr(obj),
            //         async:true,
            //         dataType:"json",
            //         headers:{"Authorization":localStorage.token},
            //         contentType:"application/json",
            //         success:function(reponse){
            //             if(reponse.code==1){
            //                 if(reponse.data.list.length!=0){
            //                     $.each(reponse.data.list,function(i,item){

            //                     })
            //                     $this.taskData = reponse.data.list;
            //                 }
            //             }else if(reponse.code==-2){

            //             }else{
            //                 $this.$Message.error(response.message)
            //             }
            //         },
            //         error:function(){
            //             $this.$Message.error(errorMessage)
            //         }
            //     });
            // },
            refreshTaskList(){
                this.getTaskList({
                    "testId":this.currentSceneId,
                    "page":this.taskCurrentPage,
                    "rows":this.taskItemPage,
                    "taskType":"",
                    "taskMode":this.currentTaskMode,
                });
            },
            refreshVmList(){
                let params = {
                    page:this.vmCurrentPage,
                    rows:this.vmItemPage,
                    projectId:this.currentProjectId,
                    order:"asc",
                    sortBy:"name",
                    name:this.formValidate.vmName,
                    ip:this.formValidate.vmIP,
                    profile:this.profileValue,
                    findPorts:true
                }
                if(this.formValidate.networkId){
                    params.networkId = this.formValidate.networkId;
                }
//      	this.refreshVmList();
                this.getVmList(params);
            },
            getTaskListDeailData(){
                let $this = this
//          axios({
//              url:this.GLOBAL._projPath_process +"overview/task/countByStatus?"+this.BASE.getParamStr({
//                  "testId":$this.currentSceneId,
//                  "taskType":$this.taskTypeTable,
//                  "node":"false"
//              }),
//          })
                let params = {
                    "testId":$this.currentSceneId,
                    "taskType":$this.taskTypeTable,
                    "node":"false"
                }
                getTaskListDetailData(params).then((response)=>{
                    if(response.code==1){
                        let _s = 0,_e = 0,_i = 0,_r = 0,starting = 0,closing = 0,stintervalBol = false;
                        _s = response.data.completed;
                        _e = response.data.error;
                        _i = response.data.initialized;
                        _r = Number(response.data.running)+Number(response.data.starting)+Number(response.data.closing);
                        starting =  response.data.starting
                        closing =  response.data.closing
                        if(_r!=0){
                            stintervalBol = true;
                        }
                        $this.$emit("success",$this.taskTypeTableTitle+'-'+_s+'-'+_e+'-'+_i+'-'+_r+'-'+stintervalBol+'-'+$this.taskCurrentPage+'-'+$this.taskItemPage)
                    }else if(response.code==-2){

                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            },
            setintervalTaskList(){
                // alert('-')
                let $this = this;
//          axios({
//              url:this.GLOBAL._projPath_process +"custom/tasks?"+this.BASE.getParamStr({
//                  "testId":this.currentSceneId,
//                  "page":this.taskCurrentPage,
//                  "rows":this.taskItemPage,
//                  "taskType":this.taskTypeTable,
//                  "node":"false"
//              }),
//          }
                let params = {
                    "testId":this.currentSceneId,
                    "page":this.taskCurrentPage,
                    "rows":this.taskItemPage,
                    "taskType":this.taskTypeTable,
                    "node":"false"
                }
                getTaskList(params).then((response)=>{
                    if(response.code==1){
                        $this.taskData = [];
                        if(response.data.list.length!=0){
                            let stintervalBol  = false
                            $this.taskData = response.data.list
                            response.data.list.forEach(function(item,i){
                                if(item.status=="running"||item.status=="starting"||item.status=="closing"){
                                    stintervalBol = true
                                }
                                $this.taskData[i].status = item.status;
                            })
                            if(!stintervalBol){
                                clearTimeout($this.headerData.serintervalTimeFun)
                            }
                        }
                        $this.getTaskListDeailData()
                    }else if(response.code==-2){

                    }else{
                        $this.$Message.error(response.message)
                    }
                })
            },
            addSelectedData(){
                let that = this,bol = true;
                let list = this.formValidate.selectedVmData || []
                if (this.selectedDataConfiger.length === 0) {
                    this.$Message.info("请选择要添加的题目")
                    return
                }
                if (this.portInputDisabled) {
                    let port = this.formValidate.serverPort || this.selectedDataConfiger[0].port
                    let repetitionList = this.selectedDataConfiger.filter(item => {
                        return item.port !== port
                    }).map(item => item.name) || []
                    if (repetitionList.length) {
                        this.$Message.info(`${repetitionList.join('，')}端口不同，无法添加`)
                        return
                    }
                    this.formValidate.serverPort = port
                }
                that.selectedDataConfiger.forEach((item,i) => {
                    if(that.selectedVmDataTable.indexOf(this.type !== 8 ? item.id : `${item.id},${item.port}`)!=-1){

                    }else{
                        bol = false
                        let vms = this.dataVmList.filter(vm => vm.questionId == item.questionId);
                        vms.forEach(vm => {
                            if(this.selectedVmDataTable.indexOf(this.type !== 8 ? vm.id : `${vm.id},${vm.port}`)!=-1){
                                //this.$Message.info("已添加")
                                return;
                            }
                            this.addVmAfterTable(vm)
                            this.selectedVmDataTable.push(this.type !== 8 ? vm.id : `${vm.id},${vm.port}`)
                            this.formValidate.selectedVmData.push({
                                "name":vm.name,
                                "targetName": vm.targetName,
                                "id":vm.id,
                                "questionId":vm.questionId,
                                "port": vm.port
                            })
                        })
                    }
                })
                if(bol){
                    that.$Message.info("请选择要添加的题目")
                }
            },
            getSelectedData(selection){
                this.selectedDataConfiger = [];
                this.selectedDataConfiger = selection;
            },
            listenConfigerChange(value){
                let _this = this;
                let item = this.configurationData.find(item => item.id === value)
                this.portInputDisabled = (item && item.name.includes('检查ip端口'))
                this.formValidate.serverPort = ''
                if(value){
                    this.selectedVmDataTable = [];
                    this.formValidate.selectedVmData = [];
                    this.profileValue = value.split('-')[1];
                    this.refreshVmList();
                    showConfiguration(value.split('-')[0]).then(function (response) {
                        if(response.code != '1'){
                        }else{
                            // _this.configerParams = true
                            _this.formValidate.Profile = response.data.data.profile ? response.data.data.profile :''
                            _this.formValidate.osInfo = response.data.data.osinfo ? response.data.data.osinfo :''
                            _this.formValidate.configContent = response.data.data.cmds;
                            _this.metadataConfigerInfor =  response.data.data
                            _this.configPanel.configName = response.data.name;
                            // _this.metadataConfigerInfor['configurationName'] = response.data.name;
                        }
                    });
                }else{
                    _this.configerParams = false;
                    _this.formValidate.Profile = ""
                    _this.formValidate.osInfo = ""
                    _this.formValidate.type = ""
                    _this.formValidate.configContent = ""
                }
                //增加profile过滤

            },
            clearConfigerChange(){
                this.selectedVmDataTable = [];
                this.formValidate.selectedVmData = [];

                this.profileValue = ""
                //增加profile过滤
                this.refreshVmList();
            },
            /**
             * @description: 鼠标移上配置显示详情
             * @param {type}
             * @return:
             */
            mouseOverConfiger(e,value){
                clearTimeout(this.optionHoverEvent)
                let _this = this;
                this.optionHoverEvent = setTimeout(() => {
                    if(this.hoverCdraBol){
                        return;
                    }
                    this.configurationInformation = true
                    this.cardPanelLeft = e.layerX +30+ 'px'
                    this.cardPanelTop = e.layerY +35+'px'
                    //查询配置详细信息
                    for (let index = 0; index < _this.configurationData.length; index++) {
                        const element = _this.configurationData[index];
                        if(element.id==value){
                            _this.configPanel.configName = element.name
                            _this.configPanel.configPath = element.path
                            _this.configPanel.configSystype = element.sysType
                            _this.configPanel.configArg = element.argArr
                            _this.configPanel.configCmd = element.cmd
                            _this.configPanel.protocol = element.protocol
                            _this.configPanel.serverPort = element.serverPort
                            _this.configPanel.language = element.language
                            // _this.configPanel.configType = response.data.data.cmds[0].allData=="True" ? '全量' : '增量'
                            // _this.configPanel.configContent = response.data.data.cmds;
                            // _this.configPanel.configContent
                            _this.configPanel.configDescription = element.description
                            _this.configPanel.configCreateTime = element.createTime
                            _this.configPanel.configCreatorName = element.creatorName
                        }
                    }
                    // return;
                    // axios({
                    //     url: '/tasktemplate/item/' +  value.split('-')[0],
                    //     method: 'get',
                    // }).then(function (response) {
                    //     if(response.code != '1'){
                    //         _this.$Message.info(response.prompt);
                    //     }else{
                    //         _this.configPanel.configName = response.data.name
                    //         _this.configPanel.configPath = response.data.data.profile
                    //         _this.configPanel.configSystype = response.data.data.osinfo
                    //         _this.configPanel.configType = response.data.data.cmds[0].allData=="True" ? '全量' : '增量'
                    //         _this.configPanel.configContent = response.data.data.cmds;
                    //         // _this.configPanel.configContent
                    //         _this.configPanel.configDescription = response.data.description
                    //         _this.configPanel.configCreateTime = response.data.createTime
                    //         _this.configPanel.configCreatorName = response.data.creatorName

                    //     }
                    // });
                }, 300);
            },
            mouseLeaveConfiger(ev,value){
                clearTimeout(this.optionOutEvent)
                this.optionOutEvent = setTimeout(() => {
                    if(!this.hoverCdraBol){
                        this.configurationInformation = false
                        this.cardPanelLeft = '0'
                        this.cardPanelTop = '0'
                    }
                }, 300);
            },
            // showConfiguration(value){
            //     this.configurationInformation = false
            //     let _this = this;
            //     if(value){
            //         axios({
            //             url: '/tasktemplate/item/' + value.split('-')[0],
            //             method: 'get',
            //         }).then(function (response) {
            //             if(response.code != '1'){
            //                 _this.$Message.info(response.prompt);
            //             }else{
            //                 _this.configerParams = true
            //                 // _this.formValidate.category = response.data.category ?  response.data.category: ''
            //                 // _this.formValidate.path = response.data.data.path ? response.data.data.path:''
            //                 _this.formValidate.items = response.data.data.arg ? response.data.data.arg:''
            //                 // _this.formValidate.items = response.data.data.arg.map((item,index)=>{
            //                 //     return {
            //                 //         index: index,
            //                 //         value :item
            //                 //     }
            //                 // })
            //                 _this.heightParams = _this.formValidate.items.length==0 ? false : true
            //                 _this.formValidate.cmd = response.data.data.cmd ? response.data.data.cmd: ''
            //                 _this.formValidate.osType = response.data.data.osType ? response.data.data.osType :''
            //                 _this.metadataConfigerInfor =  response.data.data

            //             }
            //         });
            //     }else{
            //         _this.configerParams = false;
            //         _this.formValidate.category = ""
            //         _this.formValidate.path = ""
            //         _this.formValidate.type = ""
            //         _this.formValidate.content = ""
            //         _this.formValidate.osType = ""
            //     }
            // },
            jinru(e){
                this.hoverCdraBol = true
            },
            yichu(e){
                this.hoverCdraBol = false
                this.configurationInformation = false
                this.cardPanelLeft = '0'
                this.cardPanelTop = '0'
            },
            ddd(e){
                e.preventDefault()
                e.stopPropagation();
            },
            overStyle(){
                this.boxShadow = '5px 5px 5px #ddd'
            },
            removeStyle(){
                this.boxShadow = ''
            },
        },
        watch:{
            headerData: {
                handler(newVal, oldVal) {
                },
                deep: true
            }
        },
        beforeDestroy() {
            clearTimeout(this.headerData.serintervalTimeFun)
        }
    }
</script>
<style scoped>
    .headerBtn{
        text-align: left;
        margin: 15px 0;
    }
    .headerBtn > button{
        margin-right: 15px;
    }
    .pageStyle{
        text-align:right;
        float:right;
    }
    .ivu-table-wrapper{
        overflow:visible
    }
    .pageStyleVm{
        text-align: center;
        margin-top:10px
    }
    table .ivu-poptip-confirm .ivu-poptip-body .ivu-icon{
        left: 11px
    }

    .position_i{
        position: relative;
        top: -1px;
        margin-right: 5px
    }
    /* td{
        border-right: 0 !important
    } */
    .ivu-table-tip{
        overflow: hidden !important;
    }
    .starlet{
        color: red;
        position: absolute;
        left: -60px;
        font-size: 18px;
        line-height: 38px;
        font-weight: 800;
    }
    .zIndexStyleBtn{
        position:relative;
        z-index:55
    }
    ul li{
        list-style: none
    }
    ._dot{
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #f90;
        margin-right: 5px
    }
</style>
<style>
    .btnCenter .ivu-poptip-confirm .ivu-poptip-body{
        text-align:left;
    }
</style>